<script type="text/javascript">
    {literal}
        $(document).ready(function() {
            
        });
    {/literal}
</script>

<ul class="subNavig">
    <li><a href="{$data.root}?input=list_of_clients">Clients</a></li>
    <li><a href="{$data.root}?input=list_of_users">Users</a></li>
    <li><a href="{$data.root}?input=list_of_tariffs">Tariffs</a></li>
    <li><a href="{$data.root}?input=fixed_expense">Fixed expenses</a></li>
</ul>

<h2 class="pageTitle">Fixed expenses</h2>
{include $data.pathToError}
<form action="{$data.root}?input=fixed_expense" method="post" id="addingClient">
    <div class="menu-list">
        <a href="{$data.root}?input=add_expense" class="basicButton">Add expense</a>
        <select name="action" onchange="submitForm('addingClient')">
            <option value="">Actions ...</option>
            <option value="deleteExpenses">Delete expense(s)</option>
        </select>
    </div>
    <table class="list">
        {assign var=counter value=1}
        {foreach $data.expenses as $user => $expenses}
            {if $counter==1}
                {assign var=bgClass value='bgDark'}
            {else}
                {assign var=bgClass value='bgLight'}
            {/if}
            <tr class="{$bgClass}">
                {if $counter==1}
                    {assign var=counter value=2}
                {else}
                    {assign var=counter value=1}
                {/if}
                <td colspan="2" style="text-align: left"><strong>{$user}</strong></td>
                <td style="width: 100px"><b>From</b></td>
                <td style="width: 100px"><b>Expense</b></td>
                <td></td>
            </tr>
            {foreach $expenses as $key => $expense}
                <tr class="{$bgClass}">
                    <td style="width: 40px"><input name="expenseId[]" value="{$expense.id}" type="checkbox" /></td>
                    <td style="width: 120px"></td>
                    <td>{$expense.from}</td>
                    <td>{$expense.expense}</td>
                    <td style="text-align: left">&nbsp;&nbsp;<a href="{$data.root}?input=edit_expense&expense={$expense.id}" class="filterLink">edit</a></td>
                </tr>
            {/foreach}

        {/foreach}
    </table>
</form>